<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="../style.css" rel="stylesheet" type="text/css">
<style type="text/css" media="screen">@import "../style.css";</style>

<title> VideoExpress - PHP Projet</title></head>

<body>
<div class="center">
<div class="outer" id="outer">
<div class="outer_l">
<div class="outer_r">

<!--ENTETE-->
<?php 
include ("../inc/inc-entete.php");
?>
<!--FIN ENTETE-->
<div class="right">
<a href="../Accueil.php"><span>Accueil</span></a> | <a href="Menu_Retour.php"><span>Menu Retour</span></a>
</div>
<div class="wrap main">
<div class="wrap main_l">
<div class="wrap main_r">
<!--MENU-->
<?php 
include ("../inc/inc-menu_retour.php");
?>
<!--FIN MENU-->


<!--CONTENT-->
<div class="wrap main_content_max" id="main_content">
<div class="content">
<table class="blog" cellpadding="0" cellspacing="0">
<tr><td valign="top"><div>
		
<table class="contentpaneopen"><tr>
<td class="contentheading" width="100%">ENREGISTRER UN ABONNE</td></tr></table>
<table class="contentpaneopen"><tr><td valign="top" colspan="2">
<?php
require ("../Outils.inc");
require ("../connect.php");
$Code=$_POST["Code"];
$Nom=$_POST["Nom"];
$Prenom=$_POST["Prenom"];
$NoRue=$_POST["NoRue"];
$CodePostal=$_POST["CodePostal"];
$Ville=$_POST["Ville"];
$Batiment=$_POST["Batiment"];
$Etage=$_POST["Etage"];
$Digicode=$_POST["Digicode"];
$Telephone=$_POST["Telephone"];
$Email=$_POST["Email"];
$Banque=$_POST["Banque"];
$Guichet=$_POST["Guichet"];
$Compte=$_POST["Compte"];

$resul = DB_execSQL("Select * from abonnes where Code LIKE '$Code'",$serv);
$count = mysql_num_rows($resul);

if (( $Code !="" ) && ( $Nom !="" ) && ( $NoRue !="" ) && ($CodePostal !="" ) && ( $Ville !="" ) && ( $Banque !="" ) && ($Guichet != "") && ($Compte !="") )
 {

	if ($count == 0 ) {

$req="INSERT INTO `abonnes` ( `Code` , `Nom` , `Prenom` , `NoRue` , `CodePostal` , `Ville` , `Batiment` , `Etage` , `Digicode` , `Telephone` , `Email` , `Banque` , `Guichet` , `Compte` , `NbCassettes` )
VALUES (
'$Code' , '$Nom' , '$Prenom' , '$NoRue' , '$CodePostal' , '$Ville' , '$Batiment' , '$Etage' , '$Digicode' , '$Telephone' , '$Email' , '$Banque' , '$Guichet' , '$Compte' , '0'
)";
 
DB_execSQL($req,$serv);

echo "<img src='../images/next.png'><br \>"
	."<font size='2'>Nouveau Abonne est bien enregistr�</font>";
     } else {
	echo " <img src='../images/warning.png'><br \><br \><h2>Cette code d'abonn� est existe d�j� . Veuillez - vous choisir un autre code .</h2>" ;
	}
	
} else {
echo " <img src='../images/warning.png'><br \><br \> <h2> Vous devez remplir toutes les informations obligatoires </h2> ";
}

?>
</td></tr></table>

<span class="article_separator">&nbsp;</span>

</div></td></tr></table>
</div>
</div>
</div>
</div>
</div>
</div>
<!--FIN CONTENT-->
<!-- PIED -->
<?php include ("../inc/inc-pied.php"); ?>
<!-- FIN - PIED --> 
</body>
</html>